var Notice = {
	noticeIndexInit: function(){
		$ajax({
			"url": "/broadcast/list",
			success: function(res){
				var notice = res.result.results;
				var html = 	'<div class="ub ub-f1 ub-img2 im_tab_bg">' + 
				        	'	<div class="ub-f2 ut-s c_tip ump5 upl_percent5" style="width: 50%;">'+CurrentUser.category==30?"公告标题":"Notice Title"+'</div>' + 
				        	'	<div class="ub-f1 ut-s ump5 c_tip"  style="width: 25%;">CurrentUser.category==30?"发布时间":"Public Time"+'</div>' + 
				        	'</div>';
				for (var i = 0; i < notice.length; i ++){ 
					html += '<div class="ub ub-f1 upp4 ubb b_gra c-wh" ontouchstart="zy_touch(\'btn-act\')" onclick="Notice.jumpDetail(\'' + notice[i]._id + '\', \'' + notice[i].title + '\');">' + 
				        	'	<div class="ub-f2 ut-s ump5 upl_percent5 c_gra" style="width: 48%;">' + notice[i].title + '</div>' + 
				        	'	<div class="ub-f1 ut-s ump5 c_gra"  style="width: 27%;">' + (new Date(notice[i].create)).pattern("yyyy-MM-dd") + '</div>' + 
				    		'</div>';
				}
				$("#noticeList").html(html);
			}
		});
	},
	jumpDetail: function(id,title){
		SetLS("notice",{id:id,title:title});
		OpenNewWin("index_notice_detail");
	},
	noticeDetailInit: function(){
		var _id = GetLS("notice").id;
		$ajax({
			"url": "/broadcast/detail",
			"data": {
				_id: _id
			},
			success: function(res){
				$("#con").text(res.result.content);
				$("#create").text(new Date(res.result.create).pattern("yyyy-MM-dd hh:mm:ss"));
			}
		});
	}
}